package com.imedway.ihe.dtz.xds.dao.camel;

import java.util.Date;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.openehealth.ipf.commons.ihe.xds.core.ebxml.EbXMLClassification;
import org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.EbXMLRegistryResponse30;
import org.openehealth.ipf.commons.ihe.xds.core.metadata.Association;
import org.openehealth.ipf.commons.ihe.xds.core.metadata.AssociationType;
import org.openehealth.ipf.commons.ihe.xds.core.metadata.Author;
import org.openehealth.ipf.commons.ihe.xds.core.metadata.AvailabilityStatus;
import org.openehealth.ipf.commons.ihe.xds.core.metadata.Code;
import org.openehealth.ipf.commons.ihe.xds.core.metadata.DocumentEntry;
import org.openehealth.ipf.commons.ihe.xds.core.metadata.Folder;
import org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable;
import org.openehealth.ipf.commons.ihe.xds.core.metadata.LocalizedString;
import org.openehealth.ipf.commons.ihe.xds.core.metadata.PatientInfo;
import org.openehealth.ipf.commons.ihe.xds.core.metadata.Person;
import org.openehealth.ipf.commons.ihe.xds.core.metadata.Recipient;
import org.openehealth.ipf.commons.ihe.xds.core.metadata.ReferenceId;
import org.openehealth.ipf.commons.ihe.xds.core.metadata.SubmissionSet;
import org.openehealth.ipf.commons.ihe.xds.core.metadata.Version;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import com.imedway.ihe.dtz.xds.cache.DataCacheMap;
import com.imedway.ihe.dtz.xds.cons.ConstProperties;
import com.imedway.ihe.dtz.xds.entity.camel.XdsAssociationPO;
import com.imedway.ihe.dtz.xds.entity.camel.XdsCache;
import com.imedway.ihe.dtz.xds.entity.camel.XdsDocumentEntryPO;
import com.imedway.ihe.dtz.xds.entity.camel.XdsFolderPO;
import com.imedway.ihe.dtz.xds.entity.camel.XdsSubmissionSetPO;
import com.imedway.ihe.dtz.xds.util.DateUtils;

import cn.hutool.core.lang.UUID;
import lombok.extern.slf4j.Slf4j;

/**
 * @author dtz <br/>
 * @date 2024/7/4
 */
@Slf4j
@Repository
public class Iti42Dao_CAMEL{
	
	@Autowired
	private ConstProperties constProperties;
		
	@Autowired
	private SaveBaseDao_CAMEL saveBaseDao_CAMEL;
	
	@Autowired
	private FindBaseDao_CAMEL findBaseDao_CAMEL;
	
	@Autowired
	private UpdateBaseDao_CAMEL updateBaseDao_CAMEL;
	
	@Resource
	private JdbcTemplate jdbcTemplate;
		
	public void saveSubmissionSet(EbXMLRegistryResponse30 ebXMLRegistryResponse30,SubmissionSet submissionSet,Map<String, String> map)  {
						
		String id = submissionSet.getEntryUuid();
		submissionSet.assignEntryUuid();
		map.put(id, submissionSet.getEntryUuid());
		
		List<Author> authorList = submissionSet.getAuthors();	
		LocalizedString comment = submissionSet.getComments();
		LocalizedString title = submissionSet.getTitle();
		List<EbXMLClassification> ebXMLClassificationList =	submissionSet.getExtraClassifications();
		Code code = submissionSet.getContentTypeCode();
		Map<String, List<String>> extraMetadata = submissionSet.getExtraMetadata();
		Version version = submissionSet.getVersion();
		Identifiable patientID = submissionSet.getPatientId();
		List<Recipient> recipient = submissionSet.getIntendedRecipients();
		DataCacheMap.put("SubmissionSet-author"+submissionSet.getEntryUuid(), authorList);
		DataCacheMap.put("SubmissionSet-comment"+submissionSet.getEntryUuid(), comment);
		DataCacheMap.put("SubmissionSet-ebXMLClassificationList"+submissionSet.getEntryUuid(), ebXMLClassificationList);
		DataCacheMap.put("SubmissionSet-title"+submissionSet.getEntryUuid(), title);
		DataCacheMap.put("SubmissionSet-extraMetadata"+submissionSet.getEntryUuid(), extraMetadata);
		DataCacheMap.put("SubmissionSet-version"+submissionSet.getEntryUuid(), version);
		DataCacheMap.put("SubmissionSet-code"+submissionSet.getEntryUuid(), code);
		DataCacheMap.put("SubmissionSet-patientID"+submissionSet.getEntryUuid(), patientID);
		DataCacheMap.put("SubmissionSet-recipient"+submissionSet.getEntryUuid(), recipient);
		saveXdsCache("SubmissionSet", "author",submissionSet.getEntryUuid(),authorList);
		saveXdsCache("SubmissionSet", "comment",submissionSet.getEntryUuid(),comment);
		saveXdsCache("SubmissionSet", "ebXMLClassificationList",submissionSet.getEntryUuid(),ebXMLClassificationList);
		saveXdsCache("SubmissionSet", "title",submissionSet.getEntryUuid(),title);
		saveXdsCache("SubmissionSet", "extraMetadata",submissionSet.getEntryUuid(),extraMetadata);
		saveXdsCache("SubmissionSet", "version",submissionSet.getEntryUuid(),version);
		saveXdsCache("SubmissionSet", "code",submissionSet.getEntryUuid(),code);
		saveXdsCache("SubmissionSet", "patientID",submissionSet.getEntryUuid(),patientID);
		saveXdsCache("SubmissionSet", "recipient",submissionSet.getEntryUuid(),recipient);
		
		
		XdsSubmissionSetPO xdsSubmissionSetPO = new XdsSubmissionSetPO();
		xdsSubmissionSetPO.setCreateTime(new java.sql.Timestamp(new Date().getTime()));
		xdsSubmissionSetPO.setUpdateTime(new java.sql.Timestamp(new Date().getTime()));	
		xdsSubmissionSetPO.setEntryUuid(submissionSet.getEntryUuid());
		xdsSubmissionSetPO.setHomeCommunityId(submissionSet.getHomeCommunityId()!=null?submissionSet.getHomeCommunityId():submissionSet.getEntryUuid());
		xdsSubmissionSetPO.setLogicalUuid(submissionSet.getLogicalUuid()!=null?submissionSet.getLogicalUuid():submissionSet.getEntryUuid());
		if(submissionSet.getPatientId()!=null) {
			xdsSubmissionSetPO.setPatientId(submissionSet.getPatientId().getId());
		}
		xdsSubmissionSetPO.setUniqueId(submissionSet.getUniqueId());
		xdsSubmissionSetPO.setSourceId(submissionSet.getSourceId());
		if(submissionSet.getAvailabilityStatus()!=null) {
			xdsSubmissionSetPO.setAvailabilityStatus(submissionSet.getAvailabilityStatus().getQueryOpcode());
		}else {
			xdsSubmissionSetPO.setAvailabilityStatus(AvailabilityStatus.APPROVED.getQueryOpcode());
		}
		xdsSubmissionSetPO.setSubmissionTime(DateUtils.changeTime(submissionSet.getSubmissionTime()));
		
		XdsSubmissionSetPO xdsSubmissionSetPORequest = new XdsSubmissionSetPO();
		xdsSubmissionSetPORequest.setEntryUuid(xdsSubmissionSetPO.getEntryUuid());
		List<XdsSubmissionSetPO>  xdsSubmissionSetPOList =	findBaseDao_CAMEL.GET_XdsSubmissionSetPO(xdsSubmissionSetPORequest);
		if(xdsSubmissionSetPOList!=null&&xdsSubmissionSetPOList.size()>0) {
			log.info("提交集:"+xdsSubmissionSetPO.getEntryUuid()+"已经存在,不保存");
		}else {
			saveBaseDao_CAMEL.saveSubmissionSet(xdsSubmissionSetPO);
		}
		
	}
		
	public void saveDocumentEntryList(EbXMLRegistryResponse30 ebXMLRegistryResponse30,List<DocumentEntry> documentEntryList,Map<String, String> map)  {
		
		for(DocumentEntry documentEntry:documentEntryList) {
						
			String id = documentEntry.getEntryUuid();
			documentEntry.assignEntryUuid();
			map.put(id, documentEntry.getEntryUuid());
			
			List<Author> authorList =  documentEntry.getAuthors();
			List<EbXMLClassification> ebXMLClassificationList =	documentEntry.getExtraClassifications();
			Map<String, List<String>> extraMetadata = documentEntry.getExtraMetadata();
			PatientInfo patientInfo =  documentEntry.getSourcePatientInfo();
			List<ReferenceId> referenceIdList = documentEntry.getReferenceIdList();
			LocalizedString comment = documentEntry.getComments();
			LocalizedString title = documentEntry.getTitle();
			Version version = documentEntry.getVersion();
			Code classCode= documentEntry.getClassCode();
			List<Code> confidentialityCodes= documentEntry.getConfidentialityCodes();
			List<Code> eventCodes = documentEntry.getEventCodeList();
			Code healthcareFacilityTypeCode= documentEntry.getHealthcareFacilityTypeCode();
			Code practiceSettingCode= documentEntry.getPracticeSettingCode();
			Code formatCode= documentEntry.getFormatCode();
			Person legalAuthenticator = documentEntry.getLegalAuthenticator();
			Code typeCode= documentEntry.getTypeCode();
			Identifiable patientID = documentEntry.getPatientId();
			Identifiable sourcepatientID = documentEntry.getSourcePatientId();
			DataCacheMap.put("DocumentEntry-author"+documentEntry.getEntryUuid(), authorList);
			DataCacheMap.put("DocumentEntry-referenceIdList"+documentEntry.getEntryUuid(), referenceIdList);
			DataCacheMap.put("DocumentEntry-ebXMLClassificationList"+documentEntry.getEntryUuid(), ebXMLClassificationList);
			DataCacheMap.put("DocumentEntry-patientInfo"+documentEntry.getEntryUuid(), patientInfo);
			DataCacheMap.put("DocumentEntry-extraMetadata"+documentEntry.getEntryUuid(), extraMetadata);
			DataCacheMap.put("DocumentEntry-comment"+documentEntry.getEntryUuid(), comment);
			DataCacheMap.put("DocumentEntry-title"+documentEntry.getEntryUuid(), title);
			DataCacheMap.put("DocumentEntry-version"+documentEntry.getEntryUuid(), version);
			DataCacheMap.put("DocumentEntry-classCode"+documentEntry.getEntryUuid(), classCode);
			DataCacheMap.put("DocumentEntry-confidentialityCodes"+documentEntry.getEntryUuid(), confidentialityCodes);
			DataCacheMap.put("DocumentEntry-eventCodes"+documentEntry.getEntryUuid(), eventCodes);
			DataCacheMap.put("DocumentEntry-healthcareFacilityTypeCode"+documentEntry.getEntryUuid(), healthcareFacilityTypeCode);
			DataCacheMap.put("DocumentEntry-practiceSettingCode"+documentEntry.getEntryUuid(), practiceSettingCode);
			DataCacheMap.put("DocumentEntry-formatCode"+documentEntry.getEntryUuid(), formatCode);
			DataCacheMap.put("DocumentEntry-legalAuthenticator"+documentEntry.getEntryUuid(), legalAuthenticator);
			DataCacheMap.put("DocumentEntry-typeCode"+documentEntry.getEntryUuid(), typeCode);
			DataCacheMap.put("DocumentEntry-patientID"+documentEntry.getEntryUuid(), patientID);
			DataCacheMap.put("DocumentEntry-sourcepatientID"+documentEntry.getEntryUuid(), sourcepatientID);
			saveXdsCache("DocumentEntry", "author",documentEntry.getEntryUuid(),authorList);
			saveXdsCache("DocumentEntry", "referenceIdList",documentEntry.getEntryUuid(),referenceIdList);
			saveXdsCache("DocumentEntry", "ebXMLClassificationList",documentEntry.getEntryUuid(),ebXMLClassificationList);
			saveXdsCache("DocumentEntry", "patientInfo",documentEntry.getEntryUuid(),patientInfo);
			saveXdsCache("DocumentEntry", "extraMetadata",documentEntry.getEntryUuid(),extraMetadata);
			saveXdsCache("DocumentEntry", "comment",documentEntry.getEntryUuid(),comment);
			saveXdsCache("DocumentEntry", "title",documentEntry.getEntryUuid(),title);
			saveXdsCache("DocumentEntry", "version",documentEntry.getEntryUuid(),version);
			saveXdsCache("DocumentEntry", "classCode",documentEntry.getEntryUuid(),classCode);
			saveXdsCache("DocumentEntry", "confidentialityCodes",documentEntry.getEntryUuid(),confidentialityCodes);
			saveXdsCache("DocumentEntry", "eventCodes",documentEntry.getEntryUuid(),eventCodes);
			saveXdsCache("DocumentEntry", "confidentialityCodes",documentEntry.getEntryUuid(),confidentialityCodes);
			saveXdsCache("DocumentEntry", "healthcareFacilityTypeCode",documentEntry.getEntryUuid(),healthcareFacilityTypeCode);
			saveXdsCache("DocumentEntry", "practiceSettingCode",documentEntry.getEntryUuid(),practiceSettingCode);
			saveXdsCache("DocumentEntry", "formatCode",documentEntry.getEntryUuid(),formatCode);
			saveXdsCache("DocumentEntry", "legalAuthenticator",documentEntry.getEntryUuid(),legalAuthenticator);
			saveXdsCache("DocumentEntry", "typeCode",documentEntry.getEntryUuid(),typeCode);
			saveXdsCache("DocumentEntry", "patientID",documentEntry.getEntryUuid(),patientID);
			saveXdsCache("DocumentEntry", "sourcepatientID",documentEntry.getEntryUuid(),sourcepatientID);
			
			
			XdsDocumentEntryPO po = new XdsDocumentEntryPO();
			po.setCreateTime(new java.sql.Timestamp(new Date().getTime()));
			po.setUpdateTime(new java.sql.Timestamp(new Date().getTime()));
			if(documentEntry.getClassCode()!=null) {
				po.setClassCode(documentEntry.getClassCode().getCode());
			}
			if(documentEntry.getConfidentialityCodes()!=null&&documentEntry.getConfidentialityCodes().size()>0) {
				po.setConfidentialityCodes(documentEntry.getConfidentialityCodes().get(0).getCode());
			}
			               
			po.setCreationTime(DateUtils.changeTime(documentEntry.getCreationTime()));
			
			if(documentEntry.getDocumentAvailability()!=null) {
				po.setDocumentAvailability(documentEntry.getDocumentAvailability().getOpcode());
			}
			if(documentEntry.getType()!=null) {
				po.setDocumentEntryType(documentEntry.getType().getUuid());
			}
			po.setEntryUuid(documentEntry.getEntryUuid());
			if(documentEntry.getFormatCode()!=null) {
				po.setFormatCode(documentEntry.getFormatCode().getCode());
			}
			po.setHash(documentEntry.getHash());
			if(documentEntry.getHealthcareFacilityTypeCode()!=null) {
				po.setHealthcareFacilityTypeCode(documentEntry.getHealthcareFacilityTypeCode().getCode());

			}
			po.setHomeCommunityId(documentEntry.getHomeCommunityId()!=null?documentEntry.getHomeCommunityId():documentEntry.getEntryUuid());
			po.setLanguageCode(documentEntry.getLanguageCode());
			po.setLogicalUuid(documentEntry.getLogicalUuid()!=null?documentEntry.getLogicalUuid():documentEntry.getEntryUuid());
			po.setMimeType(documentEntry.getMimeType());
			if(documentEntry.getPatientId()!=null) {
				po.setPatientId(documentEntry.getPatientId().getId());
			}
			if(documentEntry.getPracticeSettingCode()!=null) {
				po.setPracticeSettingCode(documentEntry.getPracticeSettingCode().getCode());

			}
			
			po.setRepositoryUniqueId(documentEntry.getRepositoryUniqueId()!=null?documentEntry.getRepositoryUniqueId():constProperties.getXDSDocumentRepositoryUniueId());
			po.setServiceStartTime(DateUtils.changeTime(documentEntry.getServiceStartTime()));
			po.setServiceStopTime(DateUtils.changeTime(documentEntry.getServiceStopTime()));
			po.setSize(documentEntry.getSize());
			if(documentEntry.getSourcePatientId()!=null) {
				po.setSourcePatientId(documentEntry.getSourcePatientId().getId());
			}
			if(documentEntry.getTypeCode()!=null) {
				po.setTypeCode(documentEntry.getTypeCode().getCode());
			}
			po.setUniqueId(documentEntry.getUniqueId());
			po.setUri(documentEntry.getUri());
			if(documentEntry.getVersion()!=null) {
				po.setVersion(documentEntry.getVersion().getVersionName());	
			}
			if(documentEntry.getAvailabilityStatus()!=null) {
				po.setAvailabilityStatus(documentEntry.getAvailabilityStatus().getQueryOpcode());
			}
			
			XdsDocumentEntryPO xdsDocumentEntryPORequest = new XdsDocumentEntryPO();
			xdsDocumentEntryPORequest.setEntryUuid(po.getEntryUuid());
			List<XdsDocumentEntryPO>  xdsDocumentEntryPOList =	findBaseDao_CAMEL.GET_XdsDocumentEntryPO(xdsDocumentEntryPORequest);
			if(xdsDocumentEntryPOList!=null&&xdsDocumentEntryPOList.size()>0) {
				log.info("文档:"+documentEntry.getEntryUuid()+"已经存在,不保存");
			}else {
				saveBaseDao_CAMEL.saveXdsDocumentEntryPO(po);
			}
			
		}
		
	}
	
	public void saveFolderList(EbXMLRegistryResponse30 ebXMLRegistryResponse30,List<Folder> folderList,Map<String, String> map)  {
		for(Folder folder:folderList) {
						
			String id = folder.getEntryUuid();
			folder.assignEntryUuid();
			map.put(id, folder.getEntryUuid());
			
			List<EbXMLClassification> ebXMLClassificationList =	folder.getExtraClassifications();
			Map<String, List<String>> extraMetadata = folder.getExtraMetadata();
			LocalizedString title = folder.getTitle();
			LocalizedString comment = folder.getComments();
			List<Code> codeList = folder.getCodeList();
			
			DataCacheMap.put("Folder-ebXMLClassificationList"+folder.getEntryUuid(), ebXMLClassificationList);
			DataCacheMap.put("Folder-extraMetadata"+folder.getEntryUuid(), extraMetadata);
			DataCacheMap.put("Folder-title"+folder.getEntryUuid(), title);
			DataCacheMap.put("Folder-comment"+folder.getEntryUuid(), comment);
			DataCacheMap.put("Folder-codeList"+folder.getEntryUuid(), codeList);
			saveXdsCache("Folder", "ebXMLClassificationList",folder.getEntryUuid(),ebXMLClassificationList);
			saveXdsCache("Folder", "extraMetadata",folder.getEntryUuid(),extraMetadata);
			saveXdsCache("Folder", "title",folder.getEntryUuid(),title);
			saveXdsCache("Folder", "comment",folder.getEntryUuid(),comment);
			saveXdsCache("Folder", "codeList",folder.getEntryUuid(),codeList);

			
			XdsFolderPO po = new XdsFolderPO();
			po.setCreateTime(new java.sql.Timestamp(new Date().getTime()));
			po.setUpdateTime(new java.sql.Timestamp(new Date().getTime()));
			po.setEntryUuid(folder.getEntryUuid());
			if(folder.getAvailabilityStatus()!=null) {
				po.setAvailabilityStatus(folder.getAvailabilityStatus().getQueryOpcode());
			}
			po.setHomeCommunityId(folder.getHomeCommunityId());
			po.setLogicalUuid(folder.getLogicalUuid());
			if(folder.getPatientId()!=null) {
				po.setPatientId(folder.getPatientId().getId());
			}
//			po.setSchemeName(folder.);
			po.setUniqueId(folder.getUniqueId());
			if(folder.getVersion()!=null) {
				po.setVersion(folder.getVersion().getVersionName());
			}
			
			po.setLastUpdateTime(folder.getLastUpdateTime()!=null?DateUtils.changeTime(folder.getLastUpdateTime()):
				new java.sql.Timestamp(new Date().getTime()));
			
			if(folder.getTitle()!=null) {
				po.setTitleValue(folder.getTitle().getValue());
			}
			if(folder.getComments()!=null) {
				po.setCommentValue(folder.getComments().getValue());
			}
			
			XdsFolderPO xdsFolderPORequest = new XdsFolderPO();
			xdsFolderPORequest.setEntryUuid(po.getEntryUuid());
			List<XdsFolderPO>  xdsFolderPOList = findBaseDao_CAMEL.GET_XdsFolderPO(xdsFolderPORequest);
			if(xdsFolderPOList!=null&&xdsFolderPOList.size()>0) {
				log.info("文件夹:"+folder.getEntryUuid()+"已经存在,不保存");
				updateBaseDao_CAMEL.updateXdsFolderPO(po);
			}else {
				saveBaseDao_CAMEL.saveXdsFolderPO(po);
			}	
			
		}
	}
	
	public void saveAssociationList(EbXMLRegistryResponse30 ebXMLRegistryResponse30,List<Association> associationList,Map<String, String> map)  {
		for(Association association:associationList) {
			
			association.assignEntryUuid();
			
			Map<String, List<String>> extraMetadata = association.getExtraMetadata();
			Code docCode=association.getDocCode();
			DataCacheMap.put("Association-extraMetadata"+association.getEntryUuid(), extraMetadata);
			DataCacheMap.put("Association-docCode"+association.getEntryUuid(), docCode);
			saveXdsCache("Association", "extraMetadata",association.getEntryUuid(),extraMetadata);
			saveXdsCache("Association", "docCode",association.getEntryUuid(),docCode);
			
			XdsAssociationPO po = new XdsAssociationPO();
			po.setCreateTime(new java.sql.Timestamp(new Date().getTime()));
			po.setUpdateTime(new java.sql.Timestamp(new Date().getTime()));
			po.setEntryUuid(association.getEntryUuid());
			if(association.getLabel()!=null) {
				po.setAssociationLabel(association.getLabel().getOpcode());
			}
			po.setAssociationPropagation(association.getAssociationPropagation());
			if(association.getAssociationType()!=null) {
				po.setAssociationType(association.getAssociationType().getOpcode30());
			}
			if(association.getAvailabilityStatus()!=null) {
				po.setAvailabilityStatus(association.getAvailabilityStatus().getQueryOpcode());

			}
			if(association.getNewStatus()!=null) {
				po.setNewStatus(association.getNewStatus().getQueryOpcode());	
			}
			if(association.getOriginalStatus()!=null) {
				po.setOriginalStatus(association.getOriginalStatus().getQueryOpcode());	
			}
			po.setHomeCommunityId(association.getEntryUuid());
			po.setSourceUuid(map.get(association.getSourceUuid()));
			po.setTargetUuid(map.get(association.getTargetUuid()));
			po.setPreviousVersion(association.getPreviousVersion());
			
			XdsAssociationPO xdsAssociationPORequest = new XdsAssociationPO();
			xdsAssociationPORequest.setEntryUuid(po.getEntryUuid());
			List<XdsAssociationPO>  xdsAssociationPOList = findBaseDao_CAMEL.GET_ASSOCIATIONS(xdsAssociationPORequest);
			if(xdsAssociationPOList!=null&&xdsAssociationPOList.size()>0) {
				log.info("文件夹:"+po.getEntryUuid()+"已经存在,不保存");
			}else {
				saveBaseDao_CAMEL.saveXdsAssociationPO(po);
			}	

			
			//替换操作文档修改状态
			if(AssociationType.REPLACE.equals(association.getAssociationType())) {
				XdsDocumentEntryPO xdsDocumentEntryPO = new XdsDocumentEntryPO();
				xdsDocumentEntryPO.setAvailabilityStatus(AvailabilityStatus.DEPRECATED.getQueryOpcode());
				xdsDocumentEntryPO.setEntryUuid(association.getTargetUuid());
				updateBaseDao_CAMEL.updateXdsDocumentEntryPO(xdsDocumentEntryPO);
			}
			
		}
	}
	
	public void saveXdsCache(String dataClass, String dataType,String dataEntryUuid,Object object)  {
		try {
			if(object!=null) {
				XdsCache xdsCache = new XdsCache();
				xdsCache.setDataId(UUID.fastUUID().toString());
				xdsCache.setCreateTime(new java.sql.Timestamp(new Date().getTime()));
				xdsCache.setUpdateTime(new java.sql.Timestamp(new Date().getTime()));
				xdsCache.setDataClass(dataClass);
				xdsCache.setDataType(dataType);
				xdsCache.setDataEntryUuid(dataEntryUuid);
				xdsCache.setDataContent(object.toString());
				saveBaseDao_CAMEL.saveXdsCache(xdsCache);
			}else {
				log.info(dataClass+" "+dataType+" "+dataEntryUuid+"为空");
			}						
		} catch (Exception e) {
			log.info(dataClass+" "+dataType+" "+dataEntryUuid+"");
			log.info(e.getMessage(),e);
		}
	}

}
